package com.sky.service;

import com.sky.dto.*;
import com.sky.entity.OrderDetail;
import com.sky.result.PageResult;
import com.sky.vo.OrderPaymentVO;
import com.sky.vo.OrderStatisticsVO;
import com.sky.vo.OrderSubmitVO;
import com.sky.vo.OrderVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface OrderService {

    /**
     * 用户下单
     * @param ordersSubmitDTO
     * @return
     */
    @Transactional
    OrderSubmitVO submitOrder(OrdersSubmitDTO ordersSubmitDTO);

    /**
     * 订单支付
     * @param ordersPaymentDTO
     * @return
     */
    OrderPaymentVO payment(OrdersPaymentDTO ordersPaymentDTO) throws Exception;

    /**
     * 支付成功，修改订单状态
     * @param outTradeNo
     */
    void paySuccess(String outTradeNo);

    //历史订单查询
    PageResult queryHistory(OrdersPageQueryDTO ordersPageQueryDTO);

    //查询订单详情
    OrderVO queryHistoryById(Long id);

    //取消订单
    void cancellation(Long id);

    //查询菜品详情
    List<OrderDetail> queryDetailById(Long id);


    /**
     * 客户端
     * */
    //订单搜索
    PageResult searchOrder(OrdersPageQueryDTO ordersPageQueryDTO);

    //各个状态的订单数量统计
    OrderStatisticsVO queryNumber();

    //接单
    void receive(OrdersConfirmDTO ordersConfirmDTO);

    //拒单
    void refuse(OrdersRejectionDTO ordersRejectionDTO);

    //取消订单
    void cancel(OrdersCancelDTO ordersCancelDTO);

    //派送订单
    void delivery(Long id);

    //完成订单
    void complete(Long id);

    //催单
    void reminder(Long id);
}